# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        Young  
# Name:         task01
# Description:  计算2000以内的质数
# Author:       $赵怡蕾
# Date:         2019/3/5
#-------------------------------------------------------------------------------

# 计算 2000以内的质数,以字典的形式保存
#     eg: {
#         '1到99':[2,3...],
#         '100到999':[101,...],
#         '1000到1999':[...]
#         }

def demo(number):
    list1 = []
    list2 = []
    list3 = []
    list = {'1-99':list1,'100-999':list2,'1000-2000':list3}
    num =1
    while num < number:
        num += 1
        div_num = 2
        while div_num < num:
            if num % div_num == 0:
                break
            div_num += 1
        else:
            if num <= 99:
                list1.append(num)
            elif 99 < num < 999:
                list2.append(num)
            else:
                list3.append(num)
    return list
print(demo(2000))